package SQL.abysnSQL;

/*
 * createdef ::= coldef : cd
		{:RESULT = new CreateDef(cd);:}|
		      PRIMARY KEY LBRACE colname : cn RBRACE
		{:RESULT = new CreateDef(cn);:};
			FOREIGN KEY LPAREN colnamelist:keys RPAREN REFERENCES ID:tn LPAREN colnamelist:cols RPAREN
 */

public class CreateDef {
	public ColDef col;
	public ColName colname;
	public ColName keyname;
	public String refTbl;
	public BoolCondition check;
	
	public CreateDef(ColDef col){
		this.col = col;
	}
	public CreateDef(ColName col){
		colname = col;
	}
/*
 * add foreign key
 */
	public CreateDef(ColName key, String tn, ColName col) {
		this.colname = col;
		this.keyname = key;
		this.refTbl = tn;
	}
	/**
	 * add tuple check 
	 * @param w
	 */
	public CreateDef(BoolCondition w) {
		this.check = w;
	}
	
}
